package com.spzx.product.api;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.spzx.common.core.constant.ServiceNameConstants;
import com.spzx.common.core.domain.R;
import com.spzx.product.api.domain.ProductSku;
import com.spzx.product.api.domain.dto.IndexHotData;
import com.spzx.product.api.domain.dto.ProductSkuDTO;
import com.spzx.product.api.domain.dto.SkuSearchDTO;
import com.spzx.product.api.factory.RemoteProductFallbackFactory;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@FeignClient(value = ServiceNameConstants.PRODUCT_SERVICE,
        fallbackFactory = RemoteProductFallbackFactory.class)
public interface RemoteProductSkuService {

    //ServiceNameConstants.PRODUCT_SERVICE=192.168.129.229
    // @GetMapping("sku/indexHotData")=/sku/indexHotData

    @Operation(summary = "内部调用接口：查询首页热门数据")
    @GetMapping("sku/indexHotData")
    public R<IndexHotData> indexHotData();


    @Operation(summary = "内部调用接口：查询商品分页列表")
    @GetMapping("/sku/list")
    public R<Page<ProductSku>> list(@SpringQueryMap SkuSearchDTO skuSearchDTO);

    @Operation(summary = "内部调用接口：查询sku详情数据")
    @GetMapping("/sku/getSkuDTOById/{id}")
    public R<ProductSkuDTO> getSkuDTOById(@PathVariable("id") Long id);
}
